


import java.awt.Image;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;

public class Photo{
	private File photoFile;
	private String photoName;
	private int width;
	private int height;
	private Image imgIcon;

	private int index;
	private int position_x;

	public Photo(File photoFile,
				Image imgIcon,
				String photoName,
				int width,int height){
		
		this.photoFile = photoFile;
		this.imgIcon = imgIcon;
		this.photoName = photoName;
		this.width = width;
		this.height = height;
	}
        public Photo(String url) throws IOException{
		
		this.photoFile =new File(url);
                
		this.imgIcon = ImageIO.read(this.photoFile);
		this.photoName = url;
		this.width = imgIcon.getWidth(null);
                this.height = imgIcon.getHeight(null);
	}
	
	public File getOriginalPhotoURL() {
		return photoFile;
	}
	public void setOriginalPhotoURL(File photoFile) {
		this.photoFile = photoFile;
	}

	public String getPhotoName() {
		return photoName;
	}
	public void setPhotoName(String photoName) {
		this.photoName = photoName;
	}
	public int getWidth() {
		return width;
	}
	public void setWidth(int width) {
		this.width = width;
	}
	public int getHeight() {
		return height;
	}
	public void setHeight(int height) {
		this.height = height;
	}
	
	public String toString() {
		return photoFile+"\t"+imgIcon+"\t"+photoName+"\t"+width+"\t"+height;
	}
	
	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public int getPosition_x() {
		return position_x;
	}

	public void setPosition_x(int position_x) {
		this.position_x = position_x;
	}
	
	public Image getImgIcon() {
		return imgIcon;
	}

	public void setImgIcon(Image imgIcon) {
		this.imgIcon = imgIcon;
	}

}
